<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<script>
	$(document)
			.ready(
					function() {
						var _form = $("#semesterForm").validate();
						//返回
						$('#btnBack').click(function() {
							document.semesterForm.action = "${basePath}/semesterSummary/semesterSummaryIndex";
							document.semesterForm.submit();
										
					  });
						$('#btnBack2').click(function() {
							document.semesterForm.action = "${basePath}/semesterSummary/semesterSummaryIndex";
							document.semesterForm.submit();
						  });
						//保存
						$("#btnSave")
								.click(
										function() {
											if (_form.form()) {
												if (validateSqxm()) {
													$("#btnSave").attr(
															"disabled",
															"disabled");
													document.semesterForm.action = "${basePath}/semesterSummary/modiftySemesterSummary";
													document.semesterForm.submit();
												}
											}
										});
					});
	function validateSqxm() {
		var p1 = $('input[name="p"]:checked').val();
		var p21 = $('input[name="p21"]:checked').val();
		var p22 = $('input[name="p22"]:checked').val();
		var bool = false;
		if (p1 != null && p1 != "") {
			bool = true;
		}
		if (p21 != null && p21 != "") {
			bool = true;
		}
		if (p22 != null && p22 != "") {
			bool = true;
		}
		if (bool == false) {
			layer.alert("本学期您想申请的先进项目至少选一项", {
				icon : 6
			});
			return false;
		}
		return bool;
	}
	function optionRadion(){
		  var old = null; //用来保存原来的对象
		    $("input[name='p']").each(function(){//循环绑定事件
		        if(this.checked){
		            old = this; //如果当前对象选中，保存该对象
		        }
		        this.onclick = function(){
		            if(this == old){//如果点击的对象原来是选中的，取消选中
		                this.checked = false;
		                old = null;
		            } else{
		                old = this;
		            }
		        }
		    });
	}
</script>
</head>
<body onload="javascript:viewOrEdit();">
	<form action="#" id="semesterForm" name="semesterForm">
		 <input
			type="hidden" id="zjid" name="zjid" value="${semesterSummary.zjid}" />
		<input type="hidden" id="stuid" name="stuid"
			value="${semesterSummary.stuid}" /> <input type="hidden" id="gid"
			name="gid" value="${semesterSummary.gid}" />
		<div id="view">
			<table cellpadding="0" cellspacing="0" border="0"
				class="table-border" width="95%">
				<tr>
					<td class="table-header" colspan="6">学生个人期末总结信息</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">姓名：</td>
					<td class="table-contentTD" style="width: 22%">${student.xm}</td>
					<td class="table-titleTD" style="width: 12%">学号：</td>
					<td class="table-contentTD" style="width: 22%">${student.xh}</td>
					<td class="table-titleTD" style="width: 12%">性别：</td>
					<td class="table-contentTD" style="width: 22%">${student.xb}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">班级：</td>
					<td class="table-contentTD" style="width: 22%">${student.bjmc}</td>
					<td class="table-titleTD" style="width: 12%">专业：</td>
					<td class="table-contentTD" style="width: 22%">${student.zymc}</td>
					<td class="table-titleTD" style="width: 12%">年级：</td>
					<td class="table-contentTD" style="width: 22%">${student.njmc}</td>
				</tr>
				<tr>
					<td class="table-titleTD">学期：</td>
					<td class="table-contentTD"><c:forEach items="${semesterList}"
							var="semester">
							<c:if test="${semesterSummary.semid==semester.xqid}">
					  ${semester.xqmc}
					  </c:if>
						</c:forEach></td>
					<td class="table-titleTD">政治面貌：</td>
					<td class="table-contentTD">${semesterSummary.zzmm==""? "无" :semesterSummary.zzmm}</td>
					<td class="table-titleTD">担任职务：</td>
					<td class="table-contentTD">${semesterSummary.drzw}</td>
				</tr>
				<tr>
					<td class="table-titleTD" colspan="6" style="text-align: left;">*本学期你想申请的先进项目：</td>
				</tr>
				<tr>
					<td colspan="6" class="table-contentTD" style="color: #000000">
						<c:choose>
							<c:when test="${not empty p1 && p1=='三好学生'}">
								<label><input type="radio" value="三好学生" 
									checked="checked" disabled="disabled" />三好学生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="三好学生"
									 disabled="disabled" />三好学生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p2&& p2=='好学生'}">
								<label><input type="radio" value="好学生" 
									checked="checked" disabled="disabled" />好学生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="好学生" 
									disabled="disabled" />好学生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p3&& p3=='行为达标生'}">
								<label><input type="radio" value="行为达标生" 
								 checked="checked" disabled="disabled" />行为达标生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="行为达标生" 
									 disabled="disabled" />行为达标生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p21 && p21=='优秀班干部'}">
								<label><input type="checkbox" 
									value="优秀班干部" checked="checked" disabled="disabled" />优秀班干部</label>
							</c:when>
							<c:otherwise>
								<label><input type="checkbox" 
									value="优秀班干部" disabled="disabled" />优秀班干部</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p22&& p22=='技能特长生'}">
								<label><input type="checkbox" 
									value="技能特长生" checked="checked" disabled="disabled" />技能特长生</label>
							</c:when>
							<c:otherwise>
								<label><input type="checkbox" 
									value="技能特长生" disabled="disabled" />技能特长生</label>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">本学期取得的各项荣誉：</td>
					<td colspan="5" class="table-contentTD"><textarea style="width: 90%; height: 80px;"
							 disabled="disabled">${semesterSummary.hdry}</textarea>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">备注：</td>
					<td colspan="5" class="table-contentTD"><textarea 
							 style="width: 90%; height: 80px;" 
							disabled="disabled">${semesterSummary.remark}</textarea></td>
				</tr>
			</table>
		</div>
		<div id="edit" style="display: none;">
			<table cellpadding="0" cellspacing="0" border="0"
				class="table-border" width="95%">
				<tr>
					<td class="table-header" colspan="6">期末总结信息</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">姓名：</td>
					<td class="table-contentTD" style="width: 22%">${student.xm}</td>
					<td class="table-titleTD" style="width: 12%">学号：</td>
					<td class="table-contentTD" style="width: 22%">${student.xh}</td>
					<td class="table-titleTD" style="width: 12%">性别：</td>
					<td class="table-contentTD" style="width: 22%">${student.xb}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">班级：</td>
					<td class="table-contentTD" style="width: 22%">${student.bjmc}</td>
					<td class="table-titleTD" style="width: 12%">专业：</td>
					<td class="table-contentTD" style="width: 22%">${student.zymc}</td>
					<td class="table-titleTD" style="width: 12%">年级：</td>
					<td class="table-contentTD" style="width: 22%">${student.njmc}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">学期：</td>
					<td class="table-contentTD" style="width: 22%"><select id="semid" name="semid" class="selectList">
							<option value="">请选择</option>
							<c:forEach items="${semesterList}" var="semester">
								<option value="${semester.xqid}">${semester.xqmc}</option>
							</c:forEach>
					</select></td>
					<td class="table-titleTD" style="width: 12%">政治面貌：</td>
					<td class="table-contentTD" style="width: 22%"><select id="zzmm" name="zzmm" class="selectList">
							<option value="">无</option>
							<c:forEach items="${sysCodeList}" var="code">
								<option value="${code.codename}">${code.codename}</option>
							</c:forEach>
					</select></td>
					<td class="table-titleTD" style="width: 12%">担任职务：</td>
					<td class="table-contentTD" style="width: 22%"><select id="drzw" name="drzw" class="selectList">
							<option value="">请选择</option>
							<option value="班长">班长</option>
							<option value="副班长">副班长</option>
							<option value="团支书">团支书</option>
							<option value="纪律委员">纪律委员</option>
							<option value="体育委员">体育委员</option>
							<option value="文艺委员">文艺委员</option>
							<option value="生活委员">生活委员</option>
							<option value="卫生委员">卫生委员</option>
							<option value="宣传委员">宣传委员</option>
							<option value="组织委员">组织委员</option>
							<option value="学习委员">学习委员</option>
							<option value="班主任助理">班主任助理</option>
							<option value="无">无</option>
					</select></td>
				</tr>
				<tr>
					<td class="table-titleTD" colspan="6" style="text-align: left;">*本学期你想申请的先进项目：</td>
				</tr>
				<tr>
					<td colspan="6" class="table-contentTD" style="color: #000000">
						<c:choose>
							<c:when test="${not empty p1&& p1=='三好学生'}">
								<label><input type="radio" value="三好学生" id="p"
									name="p" checked="checked"  onclick="optionRadion();"/>三好学生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="三好学生" id="p"
									name="p" onclick="optionRadion();"/>三好学生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p2&& p2=='好学生'}">
								<label><input type="radio" value="好学生" id="p" name="p"
									checked="checked" onclick="optionRadion();"/>好学生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="好学生" id="p" name="p" onclick="optionRadion();"/>好学生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p3&& p3=='行为达标生'}">
								<label><input type="radio" value="行为达标生" id="p"
									name="p" checked="checked" onclick="optionRadion();"/>行为达标生</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" value="行为达标生" id="p"
									name="p" onclick="optionRadion();"/>行为达标生</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p21&& p21=='优秀班干部'}">
								<label><input type="checkbox" id="p21" name="p21"
									value="优秀班干部" checked="checked"/>优秀班干部</label>
							</c:when>
							<c:otherwise>
								<label><input type="checkbox" id="p21" name="p21"
									value="优秀班干部" onclick="optionRadion();"/>优秀班干部</label>
							</c:otherwise>
						</c:choose> <c:choose>
							<c:when test="${not empty p22&& p22=='技能特长生'}">
								<label><input type="checkbox" id="p22" name="p22"
									value="技能特长生" checked="checked"/>技能特长生</label>
							</c:when>
							<c:otherwise>
								<label><input type="checkbox" id="p22" name="p22"
									value="技能特长生"/>技能特长生</label>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">本学期取得的各项荣誉：</td>
					<td colspan="5" class="table-contentTD"><textarea id="hdry"
							name="hdry" style="width: 90%; height: 80px;"
							placeholder="本学期取得的各项荣誉">${semesterSummary.hdry}</textarea></td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">备注：</td>
					<td colspan="5" class="table-contentTD"><textarea id="remark"
							name="remark" style="width: 90%; height: 80px;" placeholder="备注">${semesterSummary.remark}</textarea>
					</td>
				</tr>
			</table>
		</div>
		<br />
		<div id="button-view">
			<table cellpadding="1" cellspacing="1" border="0" align="left">
				<tr>
<%-- 				<kl:permission permisstionList="${permisstionList}" --%>
<%-- 											currentUser="${_login_console_user}" --%> 
<%-- 					 						currentCatalogId="<%=CatalogUtils.getCatalogId("catalog0")%>" key="modify">  --%>
					<td><input type="button" id="btnEdit" class="inputButton"
						style="text-align: center;" value="修改" autocomplete="off" 
						onclick="javascript:gotoEditPage();" /></td>
<%-- 							   </kl:permission>  --%>
					<td><input type="button" id="btnBack" class="inputButton"
						value="返回" style="text-align: center;" autocomplete="off"  /></td>
				</tr>
			</table>
		</div>
		<div id="button-edit">
			<table cellpadding="1" cellspacing="1" border="0" align="left">
				<tr>
					<td><input type="button" id="btnSave" class="inputButton"
						style="text-align: center;" value="保存" autocomplete="off"  /></td>
					<td><input type="button" id="cancelSave" class="inputButton"
						style="text-align: center;" value="取消"
						onclick="javascript:gotoViewPage();" autocomplete="off"  /></td>
					<td><input type="button" id="btnBack2" class="inputButton"
						value="返回" style="text-align: center;" autocomplete="off"  /></td>
				</tr>
			</table>
		</div>

	</form>
</body>
<script type="text/javascript">
	compareListValue(document.getElementById('semid'),
			'${semesterSummary.semid}');
	compareListValue(document.getElementById('zzmm'), '${semesterSummary.zzmm}');
	compareListValue(document.getElementById('drzw'), '${semesterSummary.drzw}');
	 if("${msg}"!=""){
	       layer.alert("${msg}", {icon: 6});
	  } 
</script>
</html>
